fix: prevent console window from appearing on Windows release builds#503
Merged
Conversation
Add CREATE_NO_WINDOW (0x08000000) flag to all child process spawns (bun.exe, taskkill, powershell, git, where) on Windows to prevent the OS from allocating a visible console window. Also change ExtHost sidecar stdout from Stdio::inherit() to Stdio::null() since the parent GUI process has no console in release builds. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows release builds, launching VSCodeee caused a separate terminal/console window to appear with bun.exe running inside it (for vscode-neovim and other extensions). This did not happen on macOS.
The root cause was that bun.exe (a console-subsystem binary) was spawned without
CREATE_NO_WINDOW(0x08000000) flag. When a GUI-subsystem parent process (Tauri app withwindows_subsystem = "windows") spawns a console-subsystem child without this flag, Windows allocates a visible console window. Additionally,Stdio::inherit()on stdout contributed to the issue since the parent has no console in release builds.Changes
CREATE_NO_WINDOWflag to allstd::process::Commandandtokio::process::Commandinvocations on Windows (6 locations across 4 files)Stdio::inherit()toStdio::null()since the parent GUI process has no console in release buildsCommandExtimports to module level with#[cfg(windows)]for consistencyHow to Test
npm run tauri:devwinor release build)🤖 Generated with Claude Code